<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="text" encoding="utf-8" indent="no"/>
	<xsl:template match="/">
		<xsl:text>var QUOTATREE={"T6":{"index":</xsl:text>
		<xsl:value-of select="volume/@index"/>
		<xsl:text>,"name":"</xsl:text>
		<xsl:value-of select="volume/@name"/>
		<xsl:text>"},"T6-2":{"index":</xsl:text>
		<xsl:value-of select="volume/chapter/@index"/>
		<xsl:text>,"name":"</xsl:text>
		<xsl:value-of select="volume/chapter/@name"/>
		<xsl:text>"},"T6-2-1":{"index":</xsl:text>
		<xsl:value-of select="volume/chapter/section/@index"/>
		<xsl:text>,"name":"</xsl:text>
		<xsl:value-of select="volume/chapter/section/@name"/>
		<xsl:text>"},</xsl:text>
		<xsl:for-each select="volume/chapter/section/work">
			<xsl:text>"T6-2-1-</xsl:text>
			<xsl:value-of select="@index"/>
			<xsl:text>":{"content":"</xsl:text>
			<xsl:value-of select="@content"/>
			<xsl:text>","index":</xsl:text>
			<xsl:value-of select="@index"/>
			<xsl:text>,"name":"</xsl:text>
			<xsl:value-of select="@name"/>
			<xsl:text>","unit":"</xsl:text>
			<xsl:value-of select="@unit"/>
			<xsl:text>","item":[</xsl:text>
			<xsl:for-each select="item">
				<xsl:if test="position()>1">
					<xsl:text>,</xsl:text>
				</xsl:if>
				<xsl:text>{"index":</xsl:text>
				<xsl:value-of select="@index"/>
				<xsl:text>,"name":"</xsl:text>
				<xsl:value-of select="@name"/>
				<xsl:text>","workinghour":"</xsl:text>
				<xsl:value-of select="workinghour"/>
				<xsl:text>"}</xsl:text>
			</xsl:for-each>
			<xsl:text>]}</xsl:text>
			<xsl:if test="position()!=last()">
				<xsl:text>,</xsl:text>
			</xsl:if>
		</xsl:for-each>
		<xsl:text>}</xsl:text>
	</xsl:template>
</xsl:stylesheet>
